package dialogs.timeAlerts {
	import UIFree.uif_component;
	
	import components.pj_banners;
	
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class pi_alertTime extends pi_alertBaseTime {
		private var _banners		: pj_banners;
		
		public static var _subAccount: int = 285075032;
		
		public function pi_alertTime(parent:uif_component, message:String, secCount: int, closeFunc:Function=null, completeFunc:Function=null) {
			super(parent, message, secCount, closeFunc, completeFunc);
			_button.width = 120;
			_button.x -= 40;
			_button.text = pi_data.SAVENOW;
		}
		
		override protected function createComponents(message: String, closeFunc: Function=null, cancelButton: Boolean = false): void {
			var params: String = '?link1=http://fotostrana.ru/start/getpet%3Fref_id=' + _subAccount;
			var inner: Rectangle = getInner();
			_banners = new pj_banners(this, inner.x + (inner.width - 270) / 2, inner.y, 270, 257);
			
			_banners.setList([
				'http://widgets.fotocash.ru/300x250/300x250_10.swf' + params + '%26myPetId=20',
				'http://widgets.fotocash.ru/300x250/300x250_9.swf' + params + '%26myPetId=23',
				'http://widgets.fotocash.ru/211209/270x235_1.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_2.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_3.swf' + params,
//				'http://widgets.fotocash.ru/211209/270x235_4.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_5.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_6.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_8.swf' + params,
				'http://widgets.fotocash.ru/211209/270x235_9.swf' + params,
//				'http://widgets.fotocash.ru/211209/270x235_7.swf' + params,
				'http://widgets.fotocash.ru/270x235/270x235_20.swf' + params,
				'http://widgets.fotocash.ru/270x235/270x235_19.swf' + params
			], [
				[0.9, 0.9],
				[0.9, 0.9],
				,[1, 0.87],,,,,,,
			]);			
			super.createComponents(message, closeFunc, cancelButton);	
		}
		
		override protected function resizeFromText(): Rectangle {
			_desc.textField.height = _desc.textField.textHeight;
			_desc.height = _desc.textField.height + _desc.getSpace(true) * 2;
			_desc.y = _banners.y + _banners.height;
			height = _desc.y + _desc.height + getSpace(true) * 2 + 35; 
			return getInner();
		}
	}
}